package com.pphh.demo.provider;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.config.ServiceConfig;
import com.pphh.demo.DemoService;

import java.io.IOException;

/**
 * Please add description here.
 *
 * @author huangyinhuang
 * @date 11/12/2018
 */
public class Provider {

    public static void main(String[] args) throws IOException {
        ServiceConfig<DemoService> service = new ServiceConfig<>();
        service.setApplication(new ApplicationConfig("first-dubbo-provider"));
        service.setRegistry(new RegistryConfig("multicast://224.5.6.7:1234"));
        service.setInterface(DemoService.class);
        service.setVersion("1.0.0");
        service.setRef(new DemoServiceImpl());
        service.export();
        System.out.println("first-dubbo-provider is running.");
        System.in.read();
    }

}
